<template>
  <a-config-provider
    :getPopupContainer="getPopupContainer"
    :locale="locale"
    :renderEmpty="customizeRenderEmpty"
  >
    <div
      id="app"
      class="app-body"
    >
      <router-view />
    </div>
  </a-config-provider>
</template>
<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
export default {
  data () {
    return {
      locale: zhCN
    }
  },
  computed: {

  },
  mounted () {
    function checkIE () {
      return (
        !!window.ActiveXObject || 'ActiveXObject' in window
      )
    }
    if (checkIE()) {
      window.addEventListener(
        'hashchange', () => {
          var currentPath = window.location.hash.slice(1)
          if (this.$route.path !== currentPath) {
            this.$router.push(currentPath)
          }
        },
        false
      )
    }
  },
  methods: {
    // 空状态
    customizeRenderEmpty () {
      return (<a-empty description={false} />)
    },
    getPopupContainer (el) {
      if (el) {
        return el.parentNode
      } else {
        return document.body
      }
    }
  }
}
</script>
<style scoped lang="less">
#settings {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 9999;
}
</style>
